package org.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

/**
 * 智能家居控制中心后端系统启动类
 */
@SpringBootApplication
public class SmartHomeApplication {

    /**
     * 设置默认时区为北京时间
     */
    @PostConstruct
    public void setTimeZone() {
        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
        System.out.println("应用时区已设置为: " + TimeZone.getDefault().getID());
    }

    public static void main(String[] args) {
        SpringApplication.run(SmartHomeApplication.class, args);
        System.out.println("智能家居控制中心后端系统启动成功！");
    }
}